package com.ruoyi.mes.utils;

import com.github.pagehelper.Page;
import com.github.pagehelper.PageInfo;

import java.util.List;

/**
 * 响应分页数据工具类
 */
public class PageInfoUtils {
    /**
     * 返回新的分页数据
     * @param dataBaseList
     * @param newList
     * @return
     */
    public static Page toPageInfo(List dataBaseList ,List newList){
        Page newPage = new Page();
        Page oldPage = (Page) dataBaseList;
        newPage.setTotal(oldPage.getTotal());
        newPage.addAll(newList);
        return newPage;
    }
}
